package control;

import java.sql.SQLException;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import dao.ProjetoDAO;

public class RemoveAction extends Action {
	
	public ActionForward execute(ActionMapping map, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) throws SQLException {
		
		String nomeUnix = request.getParameter("nomeUnix");
		Facade facade = Facade.getInstance();
		facade.removeProjeto(nomeUnix);
		
//		ProjetoDAO dao = ProjetoDAO.getInstance();
//		dao.remove(request.getParameter("nomeUnix"));
		
		return map.findForward("projetoRemovido");
	}
}
